<?php
	$pagesize=3;
	$url=$_SERVER["REQUEST_URI"];
	$url=parse_url($url);
	$url=$url['path'];
	$sqlp="SELECT * FROM content";
	$queryp=mysql_query($sqlp);
	$num=mysql_num_rows($queryp);
	$pagecount = ceil($num/$pagesize);
	if (isset($_GET["page"]))
	{
		$page=$_GET['page'];
		if ($page<1)
		{
			$page=1;$pageval=0;
		}
		else if ($page>$pagecount)
		{
			$page=$pagecount;$pageval=($pagecount-1)*$pagesize;
		}
		else
		{
			$pageval=($page-1)*$pagesize;
		}
	}
	else
	{
		$page=1;
		$pageval=0;
	}

?>